<?php
$this->display('public/header.phtml', array(
    "title"    => "留言列表",
    "styles"   => '',
    "crumbArr" => array(
        array("title" => "留言列表"),
    ),
));
?>

<div class="row">
    <div class="col-xs-12">
        <div class="row">
            <div class="col-xs-12">
                <!-- <div class="dataTables_borderWrap"> -->
                <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>编号</th>
                            <th>姓名</th>
                            <th>电话</th>
                            <th>邮箱</th>
                            <th>标题</th>
                            <th>留言内容</th>
                            <th>留言时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php foreach ($listData as $row): ?>
                            <tr>
                                <td><?php echo $row['guestbook_id']; ?></td>
                                <td><?php echo $row['name']; ?></td>
                                <td><?php echo $row['phone']; ?></td>
                                <td><?php echo $row['email']; ?></td>
                                <td>
                                    <?php echo $row['title']; ?>
                                </td>
                                <td><?php echo $row['message']; ?></td>
                                <td><?php echo date("Y-m-d H:i:s", $row['add_time']); ?></td>
                                <td>

                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <?php $this->display('public/pagination.phtml', array('paginator' => $this->paginator->style1())); ?>
            </div>
        </div>
    </div><!-- /.col -->
</div><!-- /.row -->

<?php
$this->display("public/footer.phtml", array(
    "scripts" => ''
));
?>
<script type="text/javascript">
    $(document).ready(function () {
        $(".delete-content").click(function () {
            let id = $(this).attr('data-id');
            let c = confirm("确定要删除id为 " + id + "的内容吗？");
            if (!c) {
                return false;
            }
            storeHttpRequest.request({
                dataType: "json",
                uri: "/admin/content/delete/?id=" + id,
                isOK: function (result) {
                    alert(result.message);
                    location.reload();
                },
            });
        });
    });
</script>
<?php $this->display("public/list_footer.phtml"); ?>
<?php $this->display("public/footer_body.phtml"); ?>